/**
 * Project Name:kany-utils
 * File Name:CropImage.java
 * Package Name:me.kany.utils.image.awt.crop
 * Date:2016-1-7上午11:51:54
 * Copyright (c) 2016, Jason.Wang All Rights Reserved.
 *
 */

package me.kany.utils.image.awt.crop;

import java.awt.Image;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;

import javax.swing.JFrame;

/**
 * ClassName:CropImage <br/>
 * Function: 自定义图片的面板. <br/>
 * Date: 2016-1-7 上午11:51:54 <br/>
 * 
 * @author Jason.Wang
 * @version
 * @since JDK 1.7
 * @see
 */
@SuppressWarnings("serial")
public class CropImage extends JFrame {
	private Image image = null;

	public CropImage(Image source, int startx, int starty, int width, int height) {
		this.image = createImage(new FilteredImageSource(source.getSource(), new CropImageFilter(startx, starty, width, height)));
	}

	public Image getImage() {
		return this.image;
	}
}
